package com.qf.controller;

import com.qf.feign.TestFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class CustomController {
    @Autowired
    private TestFeign testFeign;
    //从nacos配置文件中获取
    @Value("${version}")
    private String version;
    @RequestMapping("/test")
    public String customTest(){
        try {
            Thread.sleep(200);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        String test = testFeign.test();
        return test +"========version"+version;
    }

}
